﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sendlist.aspx.cs" Inherits="StoreWeb.system.order.sendlist" %>


<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="../../css/extension.css" rel="stylesheet" />
    <link href="../../lib/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" />
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>订单管理</title>
</head>
<body>
    <form id="form" runat="server">
        <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 订单管理 <span class="c-gray en">&gt;</span> 订单信息 <a class="btn btn-success radius r mr-20" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
        <div class="pd-20">
            <div class="text-c">
                <table style="text-align: left; line-height: 35px;">
                    <tr>
                        <td><span class="select-box inline" style="padding: 0px;">
                            <asp:DropDownList ID="ddliststore" CssClass="select" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddliststore_SelectedIndexChanged"></asp:DropDownList>
                        </span>
                        </td>
                        <td style="width: 350px;">
                            <input id="startTime" runat="server" class="Wdate input-text" style="width: 150px;" type="text" placeholder="开始时间" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')||\'2020-10-01\'}'})" />
                            &nbsp;-&nbsp;
                            <input id="endTime" class="Wdate input-text" type="text" style="width: 150px;" placeholder="结束时间" runat="server" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',maxDate:'2020-10-01'})" />
                        </td>
                       <%-- <td style="width: 80px;">
                            <asp:Button ID="btnday" class="btn btn-default radius" runat="server" Text="今天" OnClick="btnday_Click" /></td>
                        <td style="width: 80px;">
                            <asp:Button ID="btnweeks" class="btn btn-default radius" runat="server" Text="本周" OnClick="btnweeks_Click" /></td>
                        <td style="width: 80px;">
                            <asp:Button ID="btnmonth" class="btn btn-default radius" runat="server" Text="本月" OnClick="btnmonth_Click" /></td>
                        <td style="width: 120px;">
                            <asp:Button ID="btntree" class="btn btn-default radius" runat="server" Text="最近三月" OnClick="btntree_Click" /></td>--%>
                        <td style="width: 205px;">
                            <input type="text" class="input-text" style="width: 200px" placeholder="根据手机号搜索" id="mobile" name="mobile" runat="server"></td>
                        <td>
                            <input type="text" class="input-text" style="width: 200px" placeholder="根据订单号搜索" id="code" name="code" runat="server"></td>
                        <td style="text-align: left">
                            <asp:Button ID="btnserach" class="btn btn-success radius" runat="server" Text="搜索" OnClick="btnserach_Click" /></td>
                    </tr>
                </table>
            </div>
            <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a class="btn btn-primary radius" href="javascript:;" onclick="order_fahuo()"><%--<i class="Hui-iconfont">&#xe600;</i>--%>发货</a> </span></div>

            <table class="table table-border table-bordered table-hover table-bg table-sort">
                <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                    <ItemTemplate>
                        <asp:HiddenField ID="hidid" runat="server" Value='<%#Eval("id") %>' />
                        <thead>
                            <tr class="text-c">
                                <th colspan="9" style="text-align: left; height: 25px;"><%#Eval("username") %></th>
                            </tr>
                            <tr class="text-c">
                                <th width="25">
                                    <input type="checkbox" value="" name=""></th>
                                <th width="100">订单编号</th>
                                <th width="60">客户姓名</th>
                                <th width="100">产品类别</th>
                                <th width="150">面料</th>
                                <th width="100">创建时间</th>
                                <th width="100">订单总金额</th>
                                <th width="120">订单状态/付款状态</th>
                                <th width="150">快递信息</th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="Repeater2" runat="server">
                                <ItemTemplate>
                                    <tr class="text-c">
                                        <td>
                                            <%#(Eval("orderpaystatus").ToString()=="1"&&Eval("orderstatus").ToString()=="7")?"<input type='checkbox' class='selectorder' value='"+Eval("code")+"' />":"" %> </td>
                                        <td><%#Eval("code") %></td>
                                        <td style="text-align: left"><%#Eval("membername")+"("+Eval("membermobile")+")"%></td>
                                        <td style="text-align: left"><%#Eval("cInvCName") %></td>
                                        <td style="text-align: left"><%#Eval("cInvnote") %></td>
                                        <td><%#Eval("createtime") %></td>
                                        <td style="text-align: right"><%#Eval("price") %></td>
                                        <td style="text-align: left"><%#(BO.orderstatus)Convert.ToInt32(Eval("orderstatus")) +"/"+(BO.orderpaystatus)Convert.ToInt32(Eval("orderpaystatus")) +(Convert.ToInt32(Eval("orderpaystatus"))==2?"&nbsp;&nbsp;<a title='付款' href='javascript:;' onclick='order_buy("+Eval("id")+")'<i class='Hui-iconfont'>&#xe628;</i></a>":"")%></td>
                                        <td style="text-align: left"><%#Eval("crname") +"("+Eval("crvalue")+")" %></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </ItemTemplate>
                </asp:Repeater>

            </table>
            <div>
                <asp:HiddenField ID="hidwhere" runat="server" />
                <%-- <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" NextPageText="下一页" LastPageText="尾页" PrevPageText="上一页" UrlPaging="true" CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" PageSize="15" OnPageChanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>--%>
            </div>
        </div>
    </form>

    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
    <script src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        function order_buy(id) {
            layer.confirm('你确定要付款该订单吗？', function (index) {
                $.post("../../ajax/order.aspx", { action: "orderbuy", id: id },
                       function (data) {
                           if (data == "1") {
                               layer.msg('已支付!', { icon: 1, time: 1000 }, function () {
                                   location.reload();
                               });
                           }
                           else {
                               layer.msg("操作失败", { icon: 2, time: 1000 });
                           }
                       });
            });
        }
        //发货订单
        function order_fahuo() {
            var codes = "";
            $(".selectorder").each(function () {
                if ($(this).prop("checked") == true) {
                    if (codes == "")
                        codes = $(this).val();
                    else
                        codes += "," + $(this).val();
                }
            });
            if (codes == "")
                layer.msg("请先选择发货的订单", { icon: 0, time: 1000 });
            else {
                send('发货信息', 'senddetail.aspx', codes, 600, 400);
            }
        }

        function order_add(title, url) {
            var index = layer.open({
                type: 2,
                title: title,
                content: url
            });
            layer.full(index);
        }
        function admin_add(title, url, w, h) {
            layer_show(title, url, w, h);
        }
        function send(title, url, id, w, h) {
            layer_show(title, url + "?id=" + id, w, h);
        }
        function admin_del(obj, id) {
            layer.confirm('你确定要作废该订单吗？', function (index) {
                $.post("../../ajax/order.aspx", { action: "delete", id: id },
                       function (data) {
                           if (data == "1") {
                               layer.msg('已作废!', { icon: 1, time: 1000 }, function () {
                                   location.reload();
                               });
                           }
                           else {
                               layer.msg("操作失败", { icon: 1, time: 1000 });
                           }
                       });
            });
        }
    </script>
</body>
</html>
